package com.caigou.mapper.cms;

import com.caigou.bean.cms.entity.GovProListPrize;
import com.caigou.bean.cms.entity.GovProListPrizeWinner;
import com.caigou.bean.cms.param.GovProListPrizeWinnerParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GovProListPrizeWinnerMapper {
    GovProListPrizeWinner selectByPrimaryKey(Integer id);
    int deleteByPrimaryKey(Integer id);
    List<GovProListPrizeWinner> listPrizeWinnerByPrize(GovProListPrize prize);
    int insertSelective(GovProListPrizeWinner prizeWinner);
    int updatePrizeWinner(GovProListPrizeWinner prizeWinner);

    Integer selectMaxRank(@Param("prizeId")Integer prizeId);
    int updateRankForDelete(@Param("rank") Integer rank, @Param("prizeId")Integer prizeId);
    GovProListPrizeWinner getByRank(@Param("rank") Integer rank, @Param("prizeId")Integer prizeId);
    int updateRankForFront(GovProListPrizeWinnerParam param);
    int updateRankForBack(GovProListPrizeWinnerParam param);

    int getWinnerCountByPrizeId(@Param("prizeId")Integer prizeId);
}
